/**
 * Copyright &copy; 2021-2026 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.servicecenter.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jeeplus.servicecenter.mapper.UserInformationMapper;
import com.jeeplus.servicecenter.service.dto.ChargePostDTO;
import com.jeeplus.servicecenter.service.dto.UserInformationDTO;
import com.jeeplus.sys.constant.CommonConstants;
import com.jeeplus.sys.domain.User;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 用户管理
 *
 * @author jeeplus
 * @version 2021-09-05
 */
@Service
@Transactional
public class UserInformationService extends ServiceImpl <UserInformationMapper, User> {


    /**
     * 自定义分页检索
     *
     * @param page
     * @param queryWrapper
     * @return
     */
    public IPage <UserInformationDTO> findPage(Page <UserInformationDTO> page, QueryWrapper queryWrapper) {
        queryWrapper.eq ( "a.del_flag", CommonConstants.NOT_DELETED ); // 排除已经删除
        return baseMapper.findList ( page, queryWrapper );
    }

    /**
     * 自定义分页检索
     *
     * @param page
     * @param postId
     * @param dealTime
     * @return
     */
    public IPage <UserInformationDTO> MyFindPage(Page <UserInformationDTO> page,String postId,String roleId, String no, String dealTime ,String status) {
        return baseMapper.MyFindPage( page,postId,roleId,no,dealTime,status );
    }

    /**
     * 自定义分页检索
     *
     * @param postId
     * @return
     */
    public long findTotal(String postId) {
        return baseMapper.findTotal( postId);
    }

    /**
     * 自定义分页检索
     *
     * @param userId
     * @return
     */
    public List<ChargePostDTO> queryByUserId(String userId,String identify) {
        return baseMapper.queryByUserId( userId,identify);
    }
}
